#include <avr/wdt.h>
#include <Timer.h>
#include "Wire.h"
#include <Wstring.h>

#define DELAY1S     1000
#define DELAY5S     5000
#define MAX         4090
#define MIN         0
#define adres       12 //I2C adres
#define DEBUG


void setup() {
  Wire.begin(12);                // join i2c bus with address #12
  Wire.onReceive(receiveEvent); // register event
  Serial.begin(9600);           // start serial for output

}
void receiveEvent(int howMany)
{
  while(1 < Wire.available()) // loop through all but the last
  {
    char c = Wire.read(); // receive byte as a character
    Serial.print(c);         // print the character
  }
  int x = Wire.read();    // receive byte as an integer
  Serial.println(x);         // print the integer
}
void loop() {
  // put your main code here, to run repeatedly:
delay(100);
}
